#ifndef SVNQUALITYMETER_H
#define SVNQUALITYMETER_H

#include <QMainWindow>
#include "revisionentry.h"
#include "authorstats.h"
#include <QtCore>
#include "QtWebKit/QWebView"
#include "projectstats.h"

namespace Ui {
	class SVNQualityMeter;
}

class SVNQualityMeter : public QMainWindow
{
	Q_OBJECT

public:
	SVNQualityMeter(QWidget *parent = 0);
	~SVNQualityMeter();
	void countLines(QFile *file);
	void commitPerUser(QFile *file);
	void displayResults(void);

private:
	Ui::SVNQualityMeter *ui;
	QProcess svnLogProcess, svnDiffProcess;
	ProjectStats* project;
	QList<RevisionEntry *> revisionList;
	QHash<QString, AuthorStats *> authorList;
	QList<int> revisionMapping;
	QList<QString> authorMapping;
	QFile *diffFile;
	int totalAddedLines;
	int totalRemovedLines;

private slots:
	void on_btnAnalyse_clicked();

	void on_btnGraphe1_clicked();
	void on_btnGraphe2_clicked();
	void on_btnGraphe3_clicked();
	void on_btnGraphe4_clicked();
	void on_btnGraphe5_clicked();
	void on_btnGraphe6_clicked();
	void on_btnGraphe7_clicked();
	void on_btnGraphe8_clicked();
	void on_btnGraphe9_clicked();
	void on_btnGraphe10_clicked();
	void on_btnGraphe11_clicked();

	void svnLogProcessFinished();
	void svnDiffProcessFinished();
};

#endif // SVNQUALITYMETER_H
